Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 4 - Geometric Operations / Geometric Operations Reference
Functions / Performing Geometric Arithmetic With Shapes


GXUnionRectangle

You can use the GXUnionRectangle function to find the smallest rectangle that contains two other rectangles.

gxRectangle *GXUnionRectangle(gxRectangle *target, 
                              const gxRectangle *source, 
                              const gxRectangle *operand);
target
A pointer to a gxRectangle structure. On return, the smallest rectangle containing both the source and operand rectangles.
source
A pointer to one of the rectangles to combine.
operand
A pointer to the other rectangle to combine.
function result
The smallest rectangle containing both the source and operand
rectangles. (This rectangle is the same as the rectangle returned in the target parameter.)
DESCRIPTION
The GXUnionRectangle function calculates the smallest rectangle containing both the source rectangle and the operand rectangle and stores the results in target parameter. This function also returns the calculated rectangle as its function result.

You may specify the source rectangle or the operand rectangle as the target rectangle. In this case, the function calculates the smallest rectangle containing both of the original rectangles and then places the calculated rectangle into the source or operand rectangle, as specified.

Notice that the parameters to this function are not shapes, but pointers to the gxRectangle data structures.

ERRORS, WARNINGS, AND NOTICES
Errors
parameter_is_nil
SEE ALSO
For a discussion of the gxRectangle data structure, see Chapter 2, "Geometric Shapes," in this book.

For a discussion of geometric arithmetic, see "Geometric Arithmetic" beginning on page 4-21.

To find the intersection of two rectangles, use the GXIntersectRectangle function, described in this previous section.

To find the union of two shapes, use the GXUnionShape function, described on page 4-109.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996